<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id='app'>
        <input type="text" v-model="keyword">
        <ul>
            <li v-for="item in searchList">
                {{item.name}}
            </li>
        </ul>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                keyword: '',
                list: [{
                        name: '奔驰'
                    },
                    {
                        name: '宝马'
                    },
                    {
                        name: '保时捷'
                    },
                    {
                        name: '迈巴赫'
                    },
                ]
            },
            computed: {
                searchList(){
                    return this.list.filter(item=>item.name.includes(this.keyword))
                }
            },
            methods: {
                // getSearchList(){
                    
                // }
            },
        })
    </script>
</body>

</html>